/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.admin.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import liquibase.pro.packaged.V;
import org.springblade.core.mp.base.BaseEntity;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springblade.modules.admin.vo.contract.ContractAgreeStatusVo;
import org.springblade.modules.admin.vo.contract.ContractExtVo;

/**
 * 合同协议实体类
 *
 * @author ysq
 * @since 2025-03-27
 */
@Data
@TableName(value = "blade_contract_agree",autoResultMap = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ContractAgree对象", description = "合同协议")
public class ContractAgree extends TenantEntity {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "协议编号")
	private String agreeNo;

	@ApiModelProperty(value = "协议状态1:待回签2:待审核3:待生效4:待完结5:合同待回签6:合同已回签7:审核不通过8:已终止9:已作废10:已关闭")
	private Integer agreeStatus;

	@ApiModelProperty("状态最后变更的时间")
	private Date agreeStatusDate;


	@ApiModelProperty(value = "维保主要负责人-签约人")
	private Long maintainMainUser;

	@ApiModelProperty(value = "合同开始时间")
	private Date beginTime;

	@ApiModelProperty(value = "合同结束时间")
	private Date endTime;


	@ApiModelProperty(value = "合同附件地址,逗号分割")
	@TableField(typeHandler = FastjsonTypeHandler.class)
	private List<ContractExtVo> contractExt;

	@ApiModelProperty(value = "合同id")
	private Long contractId;

	@ApiModelProperty(value = "合同描述")
	private String contractDesc;

	@ApiModelProperty(value = "1:已回签0:否")
	private Integer backSignType;

	@ApiModelProperty(value = "1:草稿箱0:否")
	private Integer isDrafts;

	@ApiModelProperty(value = "创建人")
	private String createUserName;

	@ApiModelProperty(value = "审核人")
	private String checkUserName;

	@ApiModelProperty(value = "审核描述")
	private String statusDesc;

	@ApiModelProperty(value = "父协议")
	private Long parentId;

	@ApiModelProperty(value = "审核人")
	private Long checkUserId;

	@ApiModelProperty(value = "终止时间")
	private Date stopDate;

	@ApiModelProperty(value = "终止时间")
	private Date stopUpdateDate;


	@ApiModelProperty(value = "协议进度")
	@TableField(typeHandler = FastjsonTypeHandler.class)
	List<ContractAgreeStatusVo> agreeStatusList;

	@ApiModelProperty(value = "父合同Id")
	@TableField(exist = false)
	private Long parentContractId;

	@ApiModelProperty(value = "父协议编号")
	@TableField(exist = false)
	private String parentAgreeNo;


	@ApiModelProperty(value = "回签父合同Id")
	@TableField(exist = false)
	private Long hqParentContractId;

	@ApiModelProperty(value = "回签父协议编号")
	@TableField(exist = false)
	private String hpParentAgreeNo;

	@ApiModelProperty(value = "1:关闭，终止原因")
	private String otherDesc;

	/**
	 * 维保主要负责人-签约人
	 */
	@ApiModelProperty(value = "维保主要负责人-签约人名称在职状态")
	@TableField(exist = false)
	private Integer userStatus =1 ;
}
